﻿using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using System;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Xml.Schema;

namespace ScormModel
{
    [Serializable()]
    public class DeliveryControls
    {
        private string _tracked ;
        private string _completionSetByContent ;
        private string _objectiveSetByContent ;
          [NonSerialized]
        private XmlNode _deliveryControlsContent;
        [XmlAttribute("tracked")]
        public string Tracked
        {
            get { return this._tracked; }
            set { this._tracked = value; }
        }
        [XmlAttribute("completionSetByContent")]
        public string CompletionSetByContent
        {
            get { return this._completionSetByContent; }
            set { this._completionSetByContent = value; }
        }
        [XmlAttribute("objectiveSetByContent")]
        public string ObjectiveSetByContent
        {
            get { return this._objectiveSetByContent; }
            set { this._objectiveSetByContent = value; }
        }
       
        [XmlIgnoreAttribute]
        public XmlNode DeliveryControlsContent
        {
            get { return this._deliveryControlsContent; }
            set { this._deliveryControlsContent = value; }
        }
        public void buildDeliveryControls()
        {
            XmlAttributeCollection attList = _deliveryControlsContent.Attributes;
            if (attList.GetNamedItem("tracked") != null)
            {
                _tracked = ((XmlAttribute)attList.GetNamedItem("tracked")).Value;
            }
            if (attList.GetNamedItem("completeSetByContent") != null)
            {
                _completionSetByContent = ((XmlAttribute)attList.GetNamedItem("completeSetByContent")).Value;
            }
            if (attList.GetNamedItem("objectiveSetByContent") != null)
            {
                _objectiveSetByContent = ((XmlAttribute)attList.GetNamedItem("objectiveSetByContent")).Value;
            }
        }
    }
}
